package com.leunpha.mini.downloader.bean;

/**
 * User: zhoujingjie
 * Date: 14-6-16
 * Time: 上午10:37
 */
public class FileBean {
    private String url;         //下载文件路径
    private String savePath;    //保存路径
    private String saveName;    //保存名称
    private int splitter;       //分割器 表示由多少个线程下载一个文件
    private Object attachment;  //附加对象
    private long totalLength;    //总长度
    private long readLength;    //当前read长度

    public FileBean(String url,String savePath,String saveName){
        this(url, savePath, saveName,1);
    }

    public FileBean(String url, String savePath, String saveName, int splitter) {
        this(url, savePath, saveName, splitter,null);
    }

    public FileBean(String url, String savePath, String saveName, int splitter,Object attachment) {
        this(url, savePath, saveName, splitter, attachment,-1,0);
    }

    public FileBean(String url, String savePath, String saveName, int splitter,Object attachment,long totalLength,long readLength) {
        this.url = url;
        this.savePath = savePath;
        this.saveName = saveName;
        this.splitter = splitter;
        this.attachment = attachment;
        this.totalLength = totalLength;
        this.readLength = readLength;
    }


    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getSavePath() {
        return savePath;
    }

    public void setSavePath(String savePath) {
        this.savePath = savePath;
    }

    public String getSaveName() {
        return saveName;
    }

    public void setSaveName(String saveName) {
        this.saveName = saveName;
    }

    public int getSplitter() {
        return splitter;
    }

    public void setSplitter(int splitter) {
        this.splitter = splitter;
    }

    public Object getAttachment() {
        return attachment;
    }

    public void setAttachment(Object attachment) {
        this.attachment = attachment;
    }

    public long getTotalLength() {
        return totalLength;
    }

    public void setTotalLength(long totalLength) {
        this.totalLength = totalLength;
    }

    public long getReadLength() {
        return readLength;
    }

    public void setReadLength(long readLength) {
        this.readLength = readLength;
    }

    @Override
    public String toString() {
        return "FileBean{" +
                "url='" + url + '\'' +
                ", savePath='" + savePath + '\'' +
                ", saveName='" + saveName + '\'' +
                ", splitter=" + splitter +
                ", attachment=" + attachment +
                ", totalLength=" + totalLength +
                ", readLength=" + readLength +
                '}';
    }
}
